/***********************************************************************
    filename:   DaterDaterWindow.h
    created:    10/4/2012
    author:     4Ys

    purpose:    Defines class for Window objects in UI
*************************************************************************/
#ifndef	_DaterDaterWindow_h_
#define _DaterDaterWindow_h_

#include "DaterBaseWindow.h"
#include "DaterMainWindow.h"
#include "Dater.h"

#include <vector>

class DaterWindow : public BaseWindow
{
	/*!
	\brief
		The core class of UI, especially for operation of windows.
	*/
public:
		/* !
		\brief
			Construct the sample of class DaterWindow.

		\param id_name
			- a string to represent the prefix of the window.
			
		\param theApp
			- point to main process.
			
		\param parent
			- point to parent window.
		*/
	DaterWindow(const CEGUI::String& id_name, DaterApp* theApp, CEGUI::Window* parent = 0);
	
		/* !
			Destructor of class DaterWindow.
		*/
	~DaterWindow();
	
		/* !
		\brief
			Goto the main Window.
			
		\param targetWindow
			- point to target window.
		*/
	void gotoMainWindow(MainWindow* targetWindow);
		
		/* !
		\brief
			Goto the previous Window.
		*/
	void backToPreviousWindow();

private:
		/* !
		\brief
			a virtual function generated from class BaseWindow to show window.
		*/
	virtual void showWindow();
	
		/* !
		\brief
			a virtual function generated from class BaseWindow to hide window.
		*/
	virtual void hideWindow();

		/* !
		\brief
			Link the process when connected.
			
		\param args
			- the processing program.
		*/
	bool handle_search(const CEGUI::EventArgs& args);
	
		/* !
		\brief
			Exit the process when closed.
			
		\param args
			- the processing program.
		*/
	bool handle_exit(const CEGUI::EventArgs& args);
	
		/* !
		\brief
			Subscribe handler to each 'slot' in the layout.
		*/
    void subscribeEvents();

		//! A vector contains main windows of the process.
	std::vector<MainWindow*> _mainWindowStack;

		//! A process.
	DaterApp* _theApp;
};

#endif